vcSignalMap

vcSignalMap is the basic implementation for signal map type behaviors that contain specific types of vcSignals.

See in: Overview

Module: vcBehaviors

Parent: vcBehavior

Children: vcBooleanSignalMap

Referenced by: -

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
DirectionvcSignalMapDirectionRGets the direction of ports in the signal map.
See more
Ports can be set as inputs, outputs or undefined. If ports are defined as inputs, they cannot be used as outputs or vice versa. To set the direction use the trySetDirection Method.
ListenersvcListRWGets or sets a list of behaviors using the signal map.
MaxPortCountIntegerRWGets or sets maximum number of ports in the map.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
addPortNoneInteger index,
vcSignal signal
Connects a port at a given index to a given signal.
The port index starts from 0.
See more
The PortCount property should have enough ports. In other words, to add a boolean signal to port 3 the PortCount value should be at least 4 (ports 0-3), otherwise calling this method will return an error.

Parameters:
index (int): Port index.
signal (vcSignal): Target signal.

Exceptions:
RuntimeError: When value of the index or signal is incorrect.
RuntimeError: When given parameters are not correct.
getPortNameStringInteger indexReturns the name of a port at a given index.
See more
Note: If the port has no signal then its name is an empty string.

Parameters:
index (int): Index of the port in the map.

Returns:
String: Name of the port.

Exceptions:
RuntimeError: When value of the index is incorrect.
setPortNameNoneInteger index,
String name
Sets the name of a port at a given index to a given name.
Note: The port must have a signal in order to be assigned a name.
See more
Parameters:
index (int): Index of the port.
name (str): Name to set.

Exceptions:
RuntimeError: When value of the index is incorrect.
trySetDirectionBooleanvcSignalMapDirection typeTries to set a direction for this Signal Map.
See more
Parameters:
type (vcSignalMapDirection): Type of the direction to set.

Returns:
Boolean: If setting the direction was successful, returns True. Otherwise, returns False.

Exceptions:
RuntimeError: When value of the index is incorrect.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnDirectionChangedvcSignalMap signalMap,
vcSignalMapDirection oldValue,
vcSignalMapDirection newValue
Triggered when the value of the Direction property is changed.
See more
Parameters:
signalMap (vcSignalMap): Signal map that triggered the event.
oldValue (vcSignalMapDirection): Old value of the direction.
newValue (vcSignalMapDirection): New value of the direction.